﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace DARE.Save.DataStructures
{
    public class CSkyBoxData : ASkyData
    {
        public string Top;
        public string Bottom;
        public string Front;
        public string Back;
        public string Left;
        public string Right;


        public override void FillDataStructure(object sky)
        {
            base.FillDataStructure(sky);
            CSkybox skybox = sky as CSkybox;
            Top = CResourceMgr.GetResourceName(skybox.Top);
            Bottom = CResourceMgr.GetResourceName(skybox.Bottom);
            Front = CResourceMgr.GetResourceName(skybox.Front);
            Back = CResourceMgr.GetResourceName(skybox.Back);
            Left = CResourceMgr.GetResourceName(skybox.Left);
            Right = CResourceMgr.GetResourceName(skybox.Right);
        }

        public override void FillFromDataStructure(out object sky, params object[] paramsData)
        {
            sky = null;
            if (!(paramsData.Length > 0 && paramsData[0] is CSkyMgr))
                return;
            sky = (paramsData[0] as CSkyMgr).CreateSkybox(Name, Top, Bottom, Front, Back, Left, Right);
            //(sky as CSkybox).Name = Name;
        }
    }
}
